package com.flynn.rock.crm.entity.customer;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@Table(name = "crm_receive_customer")
@EntityListeners(AuditingEntityListener.class)
public class ReceiveCustomerEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "receive_customer_id", nullable = false)
    private Long id;

    /**
     * 客户名称
     */
    @Column(name = "customer_name")
    private String customerName;
    /**
     * 客户地址
     */
    @Column(name = "customer_address")
    private String customerAddress;
    /**
     * 电话
     */
    @Column(name = "phone")
    private String phone;
    /**
     * 申请时间
     */
    @Column(name = "apply_time")
    private LocalDateTime applyTime;
    /**
     * 贷款额度
     */
    @Column(name = "loan_limit")
    private BigDecimal loanLimit;
    /**
     * 贷款类型
     */
    @Column(name = "loan_type")
    private String loanType;
    /**
     * 资产证明
     */
    @Column(name = "asset_certificate")
    private String assetCertificate;
    /**
     * 公积金
     */
    @Column(name = "reserved_fund")
    private String reservedFund;
    /**
     * 社保
     */
    @Column(name = "social_security")
    private String socialSecurity;
    /**
     * 车辆状态
     */
    @Column(name = "car_status")
    private String carStatus;
    /**
     * 房产面积
     */
    @Column(name = "house_area")
    private String houseArea;
    /**
     * 房产类型
     */
    @Column(name = "house_type")
    private String houseType;

    @CreatedDate
    @Column(name = "create_time")
    private LocalDateTime createTime;

    @LastModifiedDate
    @Column(name = "update_time")
    private LocalDateTime updateTime;
    /**
     * 备注信息
     */
    @Column(name = "remark")
    private String remark;

    @Column(name = "auto_create_customer")
    private Boolean autoCreateCustomer = Boolean.FALSE;
}
